<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "project_highlights".
 *
 * @property string $id
 * @property string $project_id
 * @property integer $user_id
 * @property string $created_at
 */
class ProjectHighlights extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'project_highlights';
    }
    public function getProject(){
        return $this->hasOne(Project::className(),['id'=>'project_id']);
    }
    /*关联项目 配置团队表*/
    public  function getTeam(){
        return $this->hasOne(ProjectTeam::className(),['project_id'=>'project_id']);
    }
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['project_id', 'user_id'], 'required'],
            [['project_id', 'user_id'], 'integer'],
            [['created_at'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'project_id' => 'Project ID',
            'user_id' => 'User ID',
            'created_at' => 'Created At',
        ];
    }
}
